VERSION 5.00
Begin VB.Form frmZTI 
   BorderStyle     =   1  'Fixed Single
   ClientHeight    =   3705
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6120
   Icon            =   "frmZTI.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3705
   ScaleWidth      =   6120
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton cmdCancel 
      Cancel          =   -1  'True
      Caption         =   "Cancel"
      Height          =   375
      Left            =   3480
      TabIndex        =   2
      Top             =   3240
      Width           =   1215
   End
   Begin VB.ListBox lstUserList 
      Height          =   2790
      Left            =   3120
      Sorted          =   -1  'True
      TabIndex        =   0
      Top             =   360
      Width           =   2895
   End
   Begin VB.CommandButton cmdBlock 
      Default         =   -1  'True
      Height          =   375
      Left            =   4800
      TabIndex        =   1
      Top             =   3240
      Width           =   1215
   End
   Begin VB.TextBox txtDescription 
      Appearance      =   0  'Flat
      BackColor       =   &H80000004&
      BorderStyle     =   0  'None
      Height          =   3015
      Left            =   120
      Locked          =   -1  'True
      MultiLine       =   -1  'True
      TabIndex        =   3
      Text            =   "frmZTI.frx":0ABA
      Top             =   120
      Width           =   2775
   End
   Begin VB.Label lblUsers 
      Height          =   255
      Left            =   3120
      TabIndex        =   4
      Top             =   120
      Width           =   1335
   End
End
Attribute VB_Name = "frmZTI"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Dim WithEvents IRCLink As clsModIRC
Attribute IRCLink.VB_VarHelpID = -1
Dim UH As String

Private Sub cmdBlock_Click()
Dim DNick As String
Dim cfm As Byte

DNick = GetWord(lstUserList.List(lstUserList.ListIndex), 1)
' if the nick is blank cancel.
If DNick = "" Then Exit Sub
' request the userhost and don't do anything until we get it
cmdBlock.Caption = lang.Messages(60)

cmdBlock.Enabled = False
IRCLink.RawSend "USERHOST " & DNick
Do Until UH <> "": DoEvents: Loop
UH = GetHost(UH)
cfm = MsgBox(SPrintF(lang.Messages(61), DNick, UH, SoftwareName), vbYesNo + vbCritical, lang.Messages(62))
If cfm = vbNo Then Exit Sub
cfm = MsgBox(SPrintF(lang.Messages(63), DNick), vbYesNo + vbCritical, lang.Messages(62))
If cfm = vbYes Then
  If Settings.Blacklist = "" Then Settings.Blacklist = UH Else _
    Settings.Blacklist = Settings.Blacklist & "|" & UH
  MsgBox SPrintF(lang.Messages(65), DNick, SoftwareName), vbOKOnly + vbInformation, lang.Messages(64)
End If
Unload Me

End Sub

Private Sub cmdCancel_Click()
Unload Me
End Sub


Private Sub Form_Load()
cmdBlock.Caption = lang.Buttons(18)
Me.Caption = lang.Messages(58)
cmdCancel.Caption = lang.Buttons(3)
lblUsers.Caption = lang.Messages(59)


Set IRCLink = frmMain.IRCInterface
lstUserList.Clear
lstUserList.AddItem "Populating list..."

IRCLink.RequestWho

frmMain.SpeechInterface.Say txtDescription.Text

End Sub

Private Sub IRCLink_UserHost(ByVal Nick As String, ByVal host As String)
UH = host
End Sub

Private Sub IRCLink_WhoList(UserList() As String)
Dim c As Integer
Dim ChannelListString As String
Dim ig As Integer

lstUserList.Clear

For c = 1 To UBound(UserList)

  ChannelListString = GetWord(UserList(c), 5)
  If InStr(GetWord(ChannelListString, 1), "Serv") > 0 Then GoTo GoNext
  If Right(GetWord(ChannelListString, 1), 3) = "Bot" Then GoTo GoNext
  If Left(GetWord(ChannelListString, 1), 5) = "Guest" Then GoTo GoNext
  For ig = 1 To WordCount(Settings.KnownIgnores)
    If LCase(GetWord(Settings.KnownIgnores, ig)) = LCase(GetWord(ChannelListString, 1)) Then GoTo GoNext
  Next
    
  lstUserList.AddItem ChannelListString

GoNext:
Next

End Sub


Private Sub Form_Unload(Cancel As Integer)
  Set IRCLink = Nothing
End Sub


